const app = getApp();
const apis = require("../../apis/request")
let timer = null
let moveStatus = true
Page({
  data: {
    showHotClick: true,
    isFullScreen: true,
    collectionList: [],
    currentItem: {}, // 当前题目item
    sliderLeft: 30,
    searchValue: '',
    dataStorage: [],
    bannerList: [{
      id: 1,
      img: 'https://img.wlcod.com/red-packet-mall/img/banner1.webp'
    },
    {
      id: 2,
      img: 'https://img.wlcod.com/red-packet-mall/img/banner2.webp'
    },],
    dataList: []
  },
  async onLoad(options) {
    const { data } = await apis.getRedEnvelopeCoversBoxes()
    this.setData({ dataList: data })
  },
  onShow() {
    this.refreshScreenRatio();
  },
  onResize(res) {
    this.setData({ isFullScreen: res.screenRatio === 1 })
  },
  onReady() {
    this.refreshScreenRatio();
  },
  refreshScreenRatio() {
    this.setData({ isFullScreen: app.utils.isFullScreen() })
  },
  onShareAppMessage() {
    return app.helper.generateShareConfig();
  },
  onItemClick(e) {
    const id = e.currentTarget.dataset.item.id
    tt.navigateTo({ url: `/pages/boxDetail/boxDetail?id=${id}` });
  },


});
